package com.zkthink.ceres.product.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.product.entity.ProductAttrValue;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 例如：
 * 颜色：红色/白色/蓝色
 * 红色就是颜色的可选值，保存为一条记录
 * </p>
 *
 * @author JustArgo
 * @date 2020-05-03
 */
@Repository
public interface ProductAttrValueMapper extends SuperMapper<ProductAttrValue> {

    /** 根据规格id删除规格值
     * @author JustArgo 2020/5/9 9:22
     * @return
     */
    int delAttrValueByAttrId(Long attrId);

    /** 根据
     * @author JustArgo 2020/5/9 10:39
     * @return
     */
    int delAttrValueById(Long id);

    /** 根据规格id，查找对应的规格值
     * @author JustArgo 2020/5/10 18:12
     * @return
     */
    List<ProductAttrValue> selectByAttrId(Long attrId);

    /**
     * @author JustArgo 2020/5/30 10:45
     * @return
     */
    int delAttrValueByBatchAttrId(List<Long> deletedAttrId);

    /** 逻辑删除 本次操作删除的规格值
     * @author JustArgo 2020/5/30 11:55
     * @return
     */
    int delByAttrIdAndNotInIdList(@Param("attrId")Long attrId, @Param("idList")List<Long> notDeletedAttrValueIdList);
}
